package main

import (
	"net/http"
	"fmt"
	"html"
	"log"
	"time"
)

func main() {
	//http.Handle("/foo",fooHandle())
	http.HandleFunc("/bar", func(w http.ResponseWriter,r *http.Request) {
		fmt.Fprintf(w,"Hello ,%q",html.EscapeString(r.URL.Path))
	})
	//log.Fatal(http.ListenAndServe(":8080",nil))
	s := &http.Server{
		Addr           :":8080" ,       // TCP address to listen on, ":http" if empty
		Handler        :nil  ,     // handler to invoke, http.DefaultServeMux if nil
		ReadTimeout    :10 * time.Second, // maximum duration before timing out read of the request
		WriteTimeout   :10 * time.Second, // maximum duration before timing out write of the response
		MaxHeaderBytes : 1024,           // maximum size of request headers, DefaultMaxHeaderBytes if 0
	}
	log.Fatal(s.ListenAndServe())
}

func fooHandle()  {

}
